// pages/groupbooking/groupbooking.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        list: [],
        listone: [],
        time: '',
    },
    //跳转至拼团商品详情页面
    goodsdetails(e) {
        // console.log(e.currentTarget.id);
        wx.navigateTo({
            url: '/pages/goodsdetails/goodsdetails?id='+e.currentTarget.id
        })
    },
    //跳转至秒杀页面
    groupbookingdetails(e) {
        wx.navigateTo({
            url: '/pages/groupbookingdetails/groupbookingdetails?id='+this.data.listone.id
        })
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var that = this
        var uid = wx.getStorageSync('uid')
        console.log(wx.getStorageSync('token'));
        wx.request({
            url: 'http://fbj.wdmnm.vip/api/wxGroupBookingList',
            data: {
                uid: uid,
                token:wx.getStorageSync('token')
            },
            dataType: 'json',
            success: function (res) {
                that.setData({
                    list: res.data.data.list,
                    listone: res.data.data.userlist,
                    time: res.data.data.userlist.GroupBookingTime
                })
            }
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
        wx.showShareMenu({
            withShareTicket:true,
            menu:['shareAppMessage','shareTimeline']
          })
    }
})